import request from '@/utils/request'
import store from '@/store/index'
import md5 from 'js-md5'

export function login (data) {
  return request({
    url: '/displayWindowPartner/displayWindowPartnerLogin',
    method: 'post',
    params: {
      phone: data.username,
      password: md5('88*&6AKcsgskcsbdjhfvjSDFSDGjbhsdj%)(((jdhgsf!' + data.password)
    }
  })
}

export function getInfo (token) {
  return request({
    url: '/displayWindowPartner/displayWindowPartnerLoginInfo',
    method: 'get',
    params: { phone: token }
  })
}

// 获取oss配置
export function getStsMessage () {
  return request({
    url: 'http://www.lianlaoban.cn/blhcUserTest/ossConfig/getStsMessage',
    method: 'get',
    params: {}
  }).then(res => {
    store.state.ossConfig = res.data
  })
}

export function logout () {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}
